package com.earthea.scaffold.common.entity;

import com.earthea.scaffold.common.enums.HttpCodeEnum;
import lombok.Getter;
import lombok.Setter;

import java.util.Collection;

@Getter
@Setter
public class BaseCollectionRsp<T> extends BaseRsp {
    private Collection<T> rows;

    public BaseCollectionRsp() {
        setCode(HttpCodeEnum.SUCCESS.getCode());
        setMsg(HttpCodeEnum.SUCCESS.getMsg());
    }

    public BaseCollectionRsp(Collection<T> rows) {
        this();
        this.rows = rows;
    }

    public BaseCollectionRsp(HttpCodeEnum httpCodeEnum) {
        setCode(httpCodeEnum.getCode());
        setMsg(httpCodeEnum.getMsg());
    }
}
